package com.gnerv.pabu.basic.core.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gnerv.pabu.basic.core.dto.PermissionDTO;
import com.gnerv.pabu.basic.core.dto.PermissionSaveDTO;
import com.gnerv.pabu.basic.core.dto.PermissionSearchDTO;
import com.gnerv.pabu.basic.core.entity.Permission;

/**
 * <p>
 * 基础平台-权限表 服务类
 * </p>
 *
 * @author Gnerv LiGen
 * @since 2019-10-10
 */
public interface IPermissionService extends IService<Permission> {

    /**
     * 保存 权限
     *
     * @param permissionSaveDTO
     * @return
     */
    boolean savePermission(PermissionSaveDTO permissionSaveDTO);

    /**
     * 创建 权限
     *
     * @param permissionSaveDTO
     * @return
     */
    boolean createPermission(PermissionSaveDTO permissionSaveDTO);

    /**
     * 删除 权限
     *
     * @param permissionId
     * @return
     */
    boolean deleteByPermissionId(String permissionId);

    /**
     * 更新 权限
     *
     * @param permissionSaveDTO
     * @return
     */
    boolean updatePermission(PermissionSaveDTO permissionSaveDTO);


    /**
     * 查询 权限
     *
     * @param permissionId
     * @return
     */
    PermissionDTO selectPermission(String permissionId);

    /**
     * 分页条件查询 权限列表
     *
     * @param permission
     * @param current
     * @param size
     * @return
     */
    Page<PermissionDTO> listPermission(PermissionSearchDTO permission, Long current, Long size);

    boolean updatePermissionStatus(String permissionId, Integer status);
}
